package com.example.doer.reading;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by doer on 2017/7/10.
 */
/*
*
*
*
*
*
*
*
*
* 还没用到
 */
public class ViewPageAdapter extends PagerAdapter {
    private List<View>list;
    public ViewPageAdapter(List<View> l){
        this.list=l;
    }
    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }
    @Override
    public void destroyItem(ViewGroup container, int position,
                            Object object) {
        // TODO Auto-generated method stub
        container.removeView(list.get(position));
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        // TODO Auto-generated method stub
        container.addView(list.get(position));


        return list.get(position);
    }

}
